<template>
  <div class="loading-box">
    <div class="is-loading">
      <div class="curtain">
        <div class="loader"></div>
        <p class="info">{{loadText}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:["text"],
  computed:{
    loadText(){
      if(!this.text){
        return "加载中"
      }else{
        return this.text
      }
    }
  }
};
</script>

<style lang="less" scoped>
.loading-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6000000238418579);
  box-shadow: 0px 2px 26px 7px rgba(0, 0, 0, 0.03999999910593033);
  z-index:10000;
  .is-loading {
    width: 7.5625rem;
    height: 9rem;
    background: #ffffff;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .625rem;
    .curtain {
      filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
      opacity: 1;
      z-index: 99;
      display: flex;
      align-items: center;
      flex-direction: column;
      .loader {
        border-radius: 50%;
        width: 2em;
        height: 2em;
        text-indent: -9999em;
        border-top: 0.3em solid rgba(0, 0, 0, 0.05);
        border-right: 0.3em solid rgba(0, 0, 0, 0.05);
        border-bottom: 0.3em solid rgba(0, 0, 0, 0.05);
        border-left: 0.3em solid #3788fe;
        -moz-transform: translateZ(0);
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -moz-animation: loader 500ms infinite linear;
        -webkit-animation: loader 500ms infinite linear;
        animation: loader 500ms infinite linear;
        -moz-transition: all 700ms ease;
        -o-transition: all 700ms ease;
        -webkit-transition: all 700ms ease;
        transition: all 700ms ease;
        filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
        &::after {
          border-radius: 50%;
          width: 2em;
          height: 2em;
        }
      }
    }

    .info {
      color: #333333;
      font-size: 1rem;
      font-weight: 500;
      margin-top: 1.375rem;
    }
  }

  .curtain {
    background-color: white;
    -moz-transition: all 600ms ease;
    -o-transition: all 600ms ease;
    -webkit-transition: all 600ms ease;
    transition: all 600ms ease;
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
    opacity: 0;
    z-index: 0;
    overflow: hidden;
  }
  @-webkit-keyframes loader {
    0% {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
    }
    100% {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
    }
  }
  @-moz-keyframes loader {
    0% {
      -moz-transform: rotate(0deg);
      transform: rotate(0deg);
    }
    100% {
      -moz-transform: rotate(360deg);
      transform: rotate(360deg);
    }
  }
  @keyframes loader {
    0% {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
    }
    100% {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
    }
  }
}
</style>